package com.course.redis.service;

import com.course.common.model.vo.ShortUserInfo;
import com.course.common.util.AssertUtil;
import com.course.redis.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @PROJECT_NAME: course
 * @DESCRIPTION:
 * @Author: 涂玄武
 * @DATE: 2021/6/29 11:05
 */
@Service
public class UserService {

    @Resource
    private UserMapper userMapper;

    /**
     * 根据 ids 查询食客信息
     *
     * @param ids 主键 id，多个以逗号分隔，逗号之间不用空格
     * @return
     */
    public List<ShortUserInfo> findByIds(String ids) {
        AssertUtil.isNotEmpty(ids);
        String[] idArr = ids.split(",");
        List<ShortUserInfo> dinerInfos = userMapper.findByIds(idArr);
        return dinerInfos;
    }

}
